<?php 
set_time_limit(0);
ini_set("memory_limit",'128M');
ini_set("max_execution_time",'0');
ini_set('auto_detect_line_endings','true');
function getServerContent($dir){
	global $return_result;
	if(!file_exists($dir))
		$return_result[$dir]['FileNotExists']=1;	
	else if (is_dir($dir)) {
		if ($dh = opendir($dir)) {
			while (($file = readdir($dh)) !== false) {
				
				if(!is_dir($dir . $file)){
					$str = file_get_contents($dir . $file);
					$str = preg_replace("/[\r\n]+/", " ", $str);
					$return_result[$dir][$file] = md5($str);
				}
				
			}
			closedir($dh);
		}
	}else{            
			$str = file_get_contents($dir);
			$str = preg_replace("/[\r\n]+/", " ", $str);
            $return_result[$dir] = md5($str);
        }
	return $return_result;
}
$folder_path = $_REQUEST["folder_path"];
echo serialize(getServerContent($folder_path));
?>